//
//  ZBLRCategroryViewController.m
//  ZBTechniqueLibrary
//
//  Created by apple on 2018/10/10.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "ZBLRCategroryViewController.h"
#import "ZBTabbleViewLinkageVC.h"
#import "ZBCollectionViewLinkageVC.h"
@interface ZBLRCategroryViewController ()

@property (nonatomic, strong)  NSArray *dataList;
@end

@implementation ZBLRCategroryViewController
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.tableView.backgroundColor = [UIColor whiteColor];
}

#pragma mark - dataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataList.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID"];
    if(cell == nil){
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cellID"];
    }
    if(indexPath.row < self.dataList.count){
        cell.textLabel.text = self.dataList[indexPath.row];
    }
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:
            [self.navigationController pushViewController:[[ZBTabbleViewLinkageVC alloc]init] animated:YES];
            break;
        case 1:
            [self.navigationController pushViewController:[[ZBCollectionViewLinkageVC alloc]init] animated:YES];
            break;
            
        default:
            break;
    }
}

#pragma mark - lazy
- (NSArray *)dataList
{
    if(_dataList == nil)
    {
        _dataList =@[@"tableView的联动",@"collectionView的联动"];
    }
    return _dataList;
}
@end
